﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using HFController;

namespace HFWebManage.Lawyer
{
    public partial class DelegateList : HFController.BagePages
    {
        public List<hf.Model.CaseDelegate> list = new List<hf.Model.CaseDelegate>();

        protected void Page_Load(object sender, EventArgs e)
        {
            //是否登录
            this.checkAdminIsLogin();

            //是否是首次登录
            if (!Page.IsPostBack)
            {
                string PageStr = "";
                list = DelegateController.getController().getCaseDelegateList(out PageStr);
                pager.Text = PageStr;

                string Action = this.GetQuery("action");
                switch (Action)
                {
                    case "delete": //单个删除
                        int ID = int.Parse(this.GetQuery("ID"));
                        DelegateController.getController().doDelegeCaseDelegate(ID);
                        break;
                    case "deleteall": //批量删除
                        string IDS = this.GetAll("cid1");
                        DelegateController.getController().doDelegeCaseDelegate(IDS.Split(','));
                        break;
                }
            }
        }
    }
}